using System;
using System.Collections.Generic;
using System.Text;

namespace Scheduler
{
    public class TimeSlot
    {
        /*
         * The object of this class holds the information about start date
         * and end date of an activity.
         */ 

        private static int YEAR = 1970;
        private static int MONTH = 1;
        private static int DAY = 1;

        public DateTime startTime;
        public DateTime endTime;

        public TimeSlot()
        {
            startTime = new DateTime(YEAR, MONTH, DAY, 0, 0, 0);
            endTime = new DateTime(YEAR, MONTH, DAY, 0, 0, 0);
        }

        public TimeSlot(int year, int month, int day, int startHour, 
            int startMin, int endHour, int endMin )
        {
            startTime = new DateTime(year, month, day, startHour, startMin, 0);
            endTime = new DateTime(year, month, day, endHour, endMin, 0); 
        }
        public TimeSlot(DateTime startTime, DateTime endTime)
        {
            this.startTime = new DateTime( startTime.Year, startTime.Month,
                                        startTime.Day, startTime.Hour, startTime.Minute,0 );
            this.endTime = new  DateTime(endTime.Year, endTime.Month,
                                        endTime.Day, endTime.Hour, endTime.Minute, 0);
        }

        public DateTime StartTime
        {
            get { return startTime; }
        }

        public DateTime EndTime
        {
            get { return endTime; }
        }


        public override bool Equals(object obj)
        {
            if (obj is TimeSlot)
                return (this.StartTime.CompareTo(((TimeSlot)obj).StartTime) == 0
                            && this.EndTime.CompareTo(((TimeSlot)obj).EndTime) == 0);
            else return false;
        }
    }
}
